jQuery(document).ready(function() {

   $.getJSON(
   	"/operation/statistic/index",
   	function(data){
   		$("#card_toady_times").text(data.msg.card_toady_times);
        $("#card_today_users").text(data.msg.card_today_users);
        $("#staff_cards").text(data.msg.staff_cards);
        $("#member_cards").text(data.msg.member_cards);
        $("#temporary_cards").text(data.msg.temporary_cards);
        $("#shops").text(data.msg.shops);
        $("#brands").text(data.msg.brands);
        $("#card_success_times").text(data.msg.card_success_times);
        $("#card_fail_times").text(data.msg.card_fail_times);
        $("#update_time").text(data.msg.update_time);
   	}
   );

   $("#shop_box").click(function() {
       $("#myModalTitle").text("门店统计");
       $("#myModalBody").load("/operation/statistic/getShops",function(){
           $("#myModal").modal("show");
       });
   });

   $("#refresh_statistic").click(function () {
       $.get(
           "/operation/statistic/refresh",
           function(data){
               toastr["success"](data.msg,"成功");
               window.location.reload();
           }
       );
   })
});

